<!-- CREATED FOR A TOOL - DON'T EDIT!! -->


<templates>
	<types>
		<type id="System.String">string</type>
		<type id="System.Int16">short</type>
		<type id="System.Int32">int</type>
		<type id="System.Int64">long</type>
		<type id="System.Double">double</type>
		<type id="System.Single">float</type>
		<type id="System.Decimal">decimal</type>
		<type id="System.Boolean">bool</type>
		<type id="System.DateTime">DateTime</type>
		<type id="System.Byte[]">Blob</type>
		<type id="System.Guid">Guid</type>
		<type id="System.Byte">byte</type>
	</types>
	<initializes>
		<initialize id="System.String" />
		<initialize id="System.Int16" />
		<initialize id="System.Int32" />
		<initialize id="System.Int64" />
		<initialize id="System.Double" />
		<initialize id="System.Single" />
		<initialize id="System.Decimal" />
		<initialize id="System.Boolean" />
		<initialize id="System.DateTime" />
		<initialize id="System.Byte" />
		<initialize id="System.Byte[]"> = new Blob()</initialize>
		<initialize id="System.Guid"> = Guid.NewGuid()</initialize>
	</initializes>


	<visibility>
		<public>public</public>
		<private>private</private>
		<internal>internal</internal>
		<protected>protected</protected>
	</visibility>

	<virtual> virtual</virtual>
	<sealed> sealed</sealed>
	<partial> partial</partial>

	<properties>

		<field>
<![CDATA[		private {0} _{1}{2};]]>
		</field>

		<property>
<![CDATA[		{0}
		[Field("{1}"{2})]
		{3}{4} {5} {6}
		{7}
			{8}{9}
		{10}]]>
		</property>

		<propertyComments>

			<autoNumberComment>
<![CDATA[/// <summary>
		/// Returns the identifier of the persistent object. Don't set it manually!
		/// </summary>]]>
			</autoNumberComment>

			<identifierComment>
<![CDATA[/// <summary>
		/// Returns the identifier of the persistent object. Mandatory.
		/// </summary>]]>
			</identifierComment>

			<foreignKeyComment>
<![CDATA[/// <summary>
		/// The foreign key connected with another persistent object.
		/// </summary>]]>
			</foreignKeyComment>

			<propertyComment>
<![CDATA[/// <summary>
		/// This property is mapped to the "{0}" field. {1} {2}
		/// </summary>]]>
			</propertyComment>
      
      <propertyDBComment>
        <![CDATA[/// <summary>
		/// This property is mapped to the "{0}" field. {1} {2}
		/// Storage comment: {3}.
		/// </summary>]]>
      </propertyDBComment>

			<mandatoryComment>Mandatory.</mandatoryComment>
			<lengthComment>Length must be between 0 and {0} characters.</lengthComment>

		</propertyComments>

		<fieldAttribute>
			<allowDBNull>AllowDBNull</allowDBNull>
			<identifier>Identifier</identifier>
			<autoNumber>AutoNumber</autoNumber>
			<persistBehaviours>PersistBehaviours</persistBehaviours>
			<dontInsert>PersistBehaviours.DontInsert</dontInsert>
			<dontUpdate>PersistBehaviours.DontUpdate</dontUpdate>
		</fieldAttribute>

		<getAccessor>
<![CDATA[get 
			{0} 
				return _{1}; 
			{2}]]>
		</getAccessor>

		<setAccessor>
<![CDATA[
			{0}set 
			{1}
				{2}{3}_{4} = value;{5}
			{6}]]>
		</setAccessor>

		<argumentNullException>
<![CDATA[if (value == null)
					throw new ArgumentNullException("value", "Value is null.");
				]]>
		</argumentNullException>

		<argumentException>
<![CDATA[if (value != null && value.Length > {0})
					throw new ArgumentException("Value length must be between 0 and {0} characters.");

				]]>
		</argumentException>

		<onRowChanged>
<![CDATA[

				OnRowChanged("{0}");]]>
		</onRowChanged>
	
	</properties>

	<relations>

		<simpleRelation>[Relation("{0}"{1}{2})]</simpleRelation>

		<parentFirst>PersistRelationship = PersistRelationships.ParentFirst</parentFirst>		
		<childFirst>PersistRelationship = PersistRelationships.ChildFirst</childFirst>

		<manyToManyRelation>[Relation("{0}", WeakPersistent = typeof({1}), WeakRelations = "{2}"{3})]</manyToManyRelation>

		<objectHolder>
<![CDATA[		{0}
		private ObjectHolder<{1}> _{2} = new ObjectHolder<{1}>();]]>
		</objectHolder>

		<objectSetHolder>
<![CDATA[		{0}
		private ObjectSetHolder<{1}> _{2} = new ObjectSetHolder<{1}>();]]>
		</objectSetHolder>

		<propertyObjectHolder>
<![CDATA[		/// <summary>
		/// Specifies the connected "{1}" persistent object.
		/// </summary>
		[XmlIgnore]
		public{0} {1} {2}
		{3}
			get {3} return _{4}.InnerObject; {5}
			set {3} _{4}.InnerObject = value; {5}
		{5}]]>
		</propertyObjectHolder>

		<propertyObjectSetHolder>
<![CDATA[		/// <summary>
		/// Gets and sets a set of connected "{1}" persistent objects.
		/// </summary>
		[XmlIgnore]
		public{0} ObjectSet<{1}> {2}
		{3}
			get {3} return _{4}.InnerObject; {5}
		{5}]]>
		</propertyObjectSetHolder>

	</relations>

	<persistent>
<![CDATA[#region Developer's comment header
/* {0}.cs
 * 
 * author:    {1}
 * copyright: {2}
 * 
 * history:   {3}, {1}: Created.
 *
 */
#endregion
#region Using directives

using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
using System.Xml.Serialization;

using Chili.Opf3;
using Chili.Opf3.Relations;
{16}

#endregion

namespace {4}
{5}
	/// <summary>
	/// Persistent object for the "{6}" table.
	/// </summary>
	[Serializable]
	[Persistent("{6}"{7})]
	public{8}{9} class {10}{11}
	{12}
{13}
	{14}
{15}]]>
	</persistent>

	<persistentUser>
		<![CDATA[#region Developer's comment header
/* {0}.cs
 * 
 * author:    {1}
 * copyright: {2}
 * 
 * history:   {3}, {1}: Created.
 *
 */
#endregion
#region Using directives

using System;
using System.Collections.Generic;
using System.Text;
using Chili.Opf3;
using Chili.Opf3.Relations;

#endregion

namespace {4}
{5}
	/// <summary>
	/// Partial Persistent object for the "{6}" table.
	/// </summary>
	public partial class {7}
	{8}
	{9}
{10}]]>
	</persistentUser>

	<persistentAttribute>
		<poolSize>PoolSize</poolSize>
		<rights>Rights</rights>

		<persistentRights>
			<load>PersistentRights.Load</load>
			<insert>PersistentRights.Insert</insert>
			<update>PersistentRights.Update</update>
			<delete>PersistentRights.Delete</delete>
			<none>PersistentRights.None</none>
		</persistentRights>
	</persistentAttribute>
	
	<regions>
		<relationRegion>
<![CDATA[
		#region Relations

{0}

		#endregion
]]>
		</relationRegion>

		<fieldRegion>
<![CDATA[		#region Fields

{0}

		#endregion
]]>
		</fieldRegion>
	
		<propertiesRegion>
<![CDATA[
		#region Properties

{0}

		#endregion]]>
		</propertiesRegion>
	</regions>

	<interfaces>

		<iDynamicExtensible>
<![CDATA[

		#region IDynamicExtensible Members

		private IDictionary<string, object> _unknownfields = new Dictionary<string, object>();

		/// <summary>
		/// Specifies the unknown fields of the persistent object.
		/// </summary>
		public IDictionary<string, object> UnknownFields
		{
			get
			{
				return _unknownfields;
			}
		}

		#endregion]]>
		</iDynamicExtensible>
		<iDynamicExtensibleName>IDynamicExtensible</iDynamicExtensibleName>

		<iObjectNotification>
<![CDATA[

		#region IObjectNotification Members

		/// <summary>
		/// Invoked by the framework before the persistent object is populated.
		/// </summary>
		/// <param name="e">
		/// Contain information about the state of the persistent object and the
		/// <see cref="Opf3.ObjectContext">ObjectContext</see> of the current operation.
		/// </param>
		void IObjectNotification.OnBeforePopulated(ObjectNotificationEventArgs e)
		{
			// Add code here, if required. Leave empty if the event is not required.
		}

		/// <summary>
		/// Invoked by the framework after the object is populated.
		/// </summary>
		/// <param name="e">
		/// Contain information about the state of the persistent object and the
		/// <see cref="Opf3.ObjectContext">ObjectContext</see> of the current operation.
		/// </param>
		void IObjectNotification.OnAfterPopulated(ObjectNotificationEventArgs e)
		{
			// Add code here, if required. Leave empty if the event is not required.
		}

		/// <summary>
		/// Invoked by the framework before the object is inserted.
		/// </summary>
		/// <param name="e">
		/// Contain information about the state of the persistent object and the
		/// <see cref="Opf3.ObjectContext">ObjectContext</see> of the current operation.
		/// </param>
		void IObjectNotification.OnBeforeInsert(ObjectNotificationEventArgs e)
		{
			// Add code here, if required. Leave empty if the event is not required.
		}

		/// <summary>
		/// Invoked by the framework after the object is inserted.
		/// </summary>
		/// <param name="e">
		/// Contain information about the state of the persistent object and the
		/// <see cref="Opf3.ObjectContext">ObjectContext</see> of the current operation.
		/// </param>
		void IObjectNotification.OnAfterInsert(ObjectNotificationEventArgs e)
		{
			// Add code here, if required. Leave empty if the event is not required.
		}

		/// <summary>
		/// Invoked by the framework before the object is updated.
		/// </summary>
		/// <param name="e">
		/// Contain information about the state of the persistent object and the
		/// <see cref="Opf3.ObjectContext">ObjectContext</see> of the current operation.
		/// </param>
		void IObjectNotification.OnBeforeUpdate(ObjectNotificationEventArgs e)
		{
			// Add code here, if required. Leave empty if the event is not required.
		}

		/// <summary>
		/// Invoked by the framework after the object is updated.
		/// </summary>
		/// <param name="e">
		/// Contain information about the state of the persistent object and the
		/// <see cref="Opf3.ObjectContext">ObjectContext</see> of the current operation.
		/// </param>
		void IObjectNotification.OnAfterUpdate(ObjectNotificationEventArgs e)
		{
			// Add code here, if required. Leave empty if the event is not required.
		}

		/// <summary>
		/// Invoked by the framework before the object is deleted.
		/// </summary>
		/// <param name="e">
		/// Contain information about the state of the persistent object and the
		/// <see cref="Opf3.ObjectContext">ObjectContext</see> of the current operation.
		/// </param>
		void IObjectNotification.OnBeforeDelete(ObjectNotificationEventArgs e)
		{
			// Add code here, if required. Leave empty if the event is not required.
		}

		/// <summary>
		/// Invoked by the framework after the object is deleted.
		/// </summary>
		/// <param name="e">
		/// Contain information about the state of the persistent object and the
		/// <see cref="Opf3.ObjectContext">ObjectContext</see> of the current operation.
		/// </param>
		void IObjectNotification.OnAfterDelete(ObjectNotificationEventArgs e)
		{
			// Add code here, if required. Leave empty if the event is not required.
		}

		/// <summary>
		/// Invoked by the framework after the object has been marked deleted.
		/// </summary>
		/// <param name="e">
		/// Contain information about the state of the persistent object and the
		/// <see cref="Opf3.ObjectContext">ObjectContext</see> of the current operation.
		/// </param>
		void IObjectNotification.OnBeforeMarkDeleted(ObjectNotificationEventArgs e)
		{
			// Add code here, if required. Leave empty if the event is not required.
		}

		/// <summary>
		/// Invoked by the framework after the object has been marked deleted.
		/// </summary>
		/// <param name="e">
		/// Contain information about the state of the persistent object and the
		/// <see cref="Opf3.ObjectContext">ObjectContext</see> of the current operation.
		/// </param>
		void IObjectNotification.OnAfterMarkDeleted(ObjectNotificationEventArgs e)
		{
			// Add code here, if required. Leave empty if the event is not required.
		}

		#endregion]]>
		</iObjectNotification>
		<iObjectNotificationName>IObjectNotification</iObjectNotificationName>

		<iPopulateHelper>
<![CDATA[

		#region IPopulateHelper Members

		/// <summary>
		/// Indexer used to populate the persistent object. For additional information of how
		/// to implement the interface look at the
		/// <see cref="Opf3.IPopulateHelper">IPopulateHelper</see> class definition.
		/// </summary>
		/// <value>Returns the value of the requested property.</value>
		/// <param name="propertyName">
		/// Name of the property that's data is retrieved or that is populated with data from
		/// the storage.
		/// </param>
		object IPopulateHelper.this[string propertyName]
		{2}
			get
			{2}
				switch(propertyName)
				{2}
{0}
					default:
						throw new NotSupportedException("Property not found.");
				{3}
			{3}
			set
			{2}
				switch(propertyName)
				{2}
{1}
					default:
						throw new NotSupportedException("Property not found.");
				{3}
			{3}
		{3}

		#endregion]]>
		</iPopulateHelper>
		<setterCase>
<![CDATA[					case "{0}":
						this.{0} = ({1})value;
						break;]]>
		</setterCase>
		<getterCase>
<![CDATA[					case "{0}":
						return this.{0};]]>
		</getterCase>
		<iPopulateHelperName>IPopulateHelper</iPopulateHelperName>

		<iSelfContainingObject>
<![CDATA[

		#region ISelfContainingObject Members

		private ObjectInfo _objectInfo = null;

		/// <summary>
		/// Returns the <see cref="Opf3.ObjectInfo">ObjectInfo</see> object that contains all
		/// information required to make the persistent object
		/// <see cref="Opf3.ObjectContext">independent from any ObjectContext</see>.
		/// </summary>
		/// <value>
		/// 	<see cref="Opf3.ObjectInfo">ObjectInfo</see> object that holds the status
		/// information of the persistent object.
		/// </value>
		ObjectInfo ISelfContainingObject.ObjectInfo
		{
			get { return _objectInfo; }
			set { _objectInfo = value; }
		}

		#endregion]]>
		</iSelfContainingObject>
		<iSelfContainingObjectName>ISelfContainingObject</iSelfContainingObjectName>

		<iNotifyPropertyChanged>
<![CDATA[

		#region INotifyPropertyChanged Members

		/// <summary>
		/// Invokes the "PropertyChanged" event if a property has been changed and
		/// somebody subscribed the event.
		/// </summary>
		private void OnRowChanged(string propertyName)
		{
			if (PropertyChanged != null)
				PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
		}

		/// <summary>
		/// Event is fired if a property of the persistent changed.
		/// </summary>
		public event PropertyChangedEventHandler PropertyChanged;

		#endregion]]>
		</iNotifyPropertyChanged>
		<iNotifyPropertyChangedName>INotifyPropertyChanged</iNotifyPropertyChangedName>

	</interfaces>
</templates>